package com.schoolCommunity.mapper;

import com.schoolCommunity.entity.ForIndex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author YTH
 * @since 2020-10-08
 */
public interface ForIndexMapper extends BaseMapper<ForIndex> {

    //获取最后插入的id
    @Select("SELECT LAST_INSERT_ID();")
    public long getLastId();

    //点赞
    @Update("update `for_index` set loves=loves+1 where id = #{id}")
    public Integer AddLovesForIndex(long id);

}
